package com.sztz.design.buildsingleton;

/**
 * 静态内部类单例模式
 * @author yzy
 * @date 2022/8/16 16:44
 */
public class StaticInnerClassPattern {
    /**
     * 静态内部类
     */
    private static class StaticInnerClassPatternHolder{
        private static final StaticInnerClassPattern INSTANCE = new StaticInnerClassPattern();
    }
    /**
     * 私有的构造方法
     */
    private StaticInnerClassPattern(){}
    /**
     * 返回静态内部类实例
     * @return StaticInnerClassPattern
     * @author yzy
     * @date 2022/8/16 16:44
     */
    public static final StaticInnerClassPattern getInstance(){
        return StaticInnerClassPatternHolder.INSTANCE;
    }
}
